<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>业务</title>
    <s:head/>
    <style type="text/css">
        table {
            clear: both;
        }

        div {
            clear: both;
        }

        ul, li {
            list-style: none;
        }

        .li1 {
            list-style: none;
            float: left;
        }

        .li2 {
            list-style: none;
            float: left;
        }

        .ul1 {
            list-style: none;
            clear: left;
        }

        .pointer {
            cursor: pointer;
        }
    </style>
</head>
<script type="text/javascript">
    function isNull(value) {
        if (!value) {
            return "undefined";
        } else {
            return value;
        }
    }

    function isUndefined(value) {
        if (value.indexOf("undefined") == 0) {
            return "";
        } else {
            return value;
        }
    }

    //截取0至fromIndex前的字符串
    function subStringBySamble(value, punctuation, fromIndex) {
        if (value.indexOf(punctuation, fromIndex) > -1) {
            return value.substring(0, fromIndex);
        } else {
            return value;
        }
    }

    $(function () {
        //初始始化tab
        $("#tabs").tabs();
    });

    //初始化表单
    $(function () {
        var option = {
            success: function showResponse(responseText, statusText, xhr,
                                           $form) {
                if ($.parseJSON(responseText.msg).state == 1) {
                    alert($.parseJSON(responseText.msg).msg);
                    location.href = "business-businessList";
                }
            }
        };
        $("#businessForm").ajaxForm(option);
    });

    //收货公司名称
    $(function () {
        $("#arr_company").success: function (data) {({
            source: function (request, response) {
                $.ajax({
                    url: "contacter-findListByName",
                    dataType: "json",
                    type: "post",
                    data: {
                        name: request.term
                    },
                    success: function (data) {
                        response($.map(data.contacters, function (item) {
                            return {
                                id: item.id,
                                username: item.name,
                                phone: item.phone,
                                label: item.name + " - " + item.company,
                                value: item.company,
                                address: item.address
                            };
                        }));
                    }
                });
            },
            minLength: 1,
            select: function (event, ui) {
                $("#arr_company_id").val(ui.item.id);
                $("#arr_con_name").val(ui.item.username);
                $("#arr_con_phone").val(ui.item.phone);
            }
        });
    });

    //船务公司
    $(function () {
        $("#book_boat_id").autocomplete({
            source: function (request, response) {
                $.ajax({
                    url: "business-findCompanysByNameType",
                    dataType: "json",
                    type: "post",
                    data: {
                        com_type: "CC",
                        sup_type: "F",//订舱业务类型
                        com_name: request.term
                    },
                    success: function (data) {
                        response($.map(data.companys, function (item) {
                            return {
                                id: item.id,
                                name: item.name,
                                value: item.name
                            };
                        }));
                    }
                });
            },
            minLength: 0,
            select: function (event, ui) {
                $("#book_boat").val(ui.item.id);
            }
        });

        $("#book_boat_id").bind("click", function () {
            $("#book_boat_id").trigger("keydown.autocomplete");
        });
    });
    //大船公司
    $(function () {
        $("#book_ship_id").autocomplete({
            source: function (request, response) {
                $.ajax({
                    url: "business-findCompanysByNameType",
                    dataType: "json",
                    type: "post",
                    data: {
                        com_type: "SC",
                        com_name: request.term
                    },
                    success: function (data) {
                        response($.map(data.companys, function (item) {
                            return {
                                id: item.id,
                                name: item.name,
                                value: item.name
                            };
                        }));
                    }
                });
            },
            minLength: 1,
            select: function (event, ui) {
                $("#book_ship").val(ui.item.id);
            }
        });
    });

    var curObjModify = null;//记录当前修改的数据
    var goodListTrId = "";//记录当前修改的数据的tr  id
    //订舱修改操作
    function book_modify(obj) {
        if (curObjModify == null)
            $(curObjModify).css("color", "red");
        curObjModify = obj;
        goodListTrId = obj.id;
        $(obj).css("color", "red");
        var tds = $(obj).find("td");
        $("#goodsName").val($(tds[0]).text());
        $("#weight").val($(tds[1]).text());
        $("#volume").val($(tds[2]).text());
        var container = $(tds[3]).text();
        var containers = container.split(",");
        for (var i = 0; i < containers.length; i++) {
            var types = containers[i].split("X");
            if (types[1] == "20'HD") {
                $("#model1").val(types[0]);
            } else if (types[1] == "40'") {
                $("#model2").val(types[0]);
            } else if (types[1] == "40'HQ") {
                $("#model3").val(types[0]);
            } else if (types[1] == "45'") {
                $("#model4").val(types[0]);
            }
        }
        $("#isModifyId").val($(tds[4]).text());
    }

    //订舱  确认货物
    function confirm() {
        var goodsName = $("#goodsName").val();
        var weight = $("#weight").val();
        var volume = $("#volume").val();
        var model1 = $("#model1").val();
        var model2 = $("#model2").val();
        var model3 = $("#model3").val();
        var model4 = $("#model4").val();
        var model = "";
        if ((model1 == null || model1 == "")
                && (model2 == null || model2 == "")
                && (model3 == null || model3 == "")
                && (model4 == null || model4 == "")) {
            alert("请填写柜型!");
            return;
        }
        model = isUndefined(isNull(model1) + "X20'HD,")
                + isUndefined(isNull(model2) + "X40',")
                + isUndefined(isNull(model3) + "X40'HQ,")
                + isUndefined(isNull(model4) + "X45'");
        model = subStringBySamble(model, ",", model.length - 1);
        var id = "";
        if ($("#isModifyId").val() == null || $("#isModifyId").val() == ""
                || $("#isModifyId").val() == "undefined") {
            id = "";
        } else {
            id = $("#isModifyId").val();
        }
        if ($("#" + goodListTrId).length != 0) {
            $("#" + goodListTrId).remove();
        }
        if (goodListTrId == "") {
            goodListTrId = "goodLists" + new Date().getTime();
        }
        $("#goodsList").append(
                "<tr id='" + goodListTrId
                + "' onclick='book_modify(this);' class='pointer'><td>"
                + goodsName + "</td><td>" + weight + "</td><td>"
                + volume + "</td><td>" + model
                + "</td><td style=\"display:none;\">" + id
                + "</td></tr>");

        curObjModify = null;
        goodListTrId = "";
        clearData("newGoods");
    }

    //清除数据
    function clearData(id) {
        $("#" + id).find("input:text").each(function (i) {
            this.value = "";
        });
        $("#" + id).find("input:hidden").each(function (i) {
            this.value = "";
        });
    }

    function check() {
        //组装订舱业务
        var book_trs = $("#goodsList tr");
        if (book_trs.length > 1) {
            var books = $(book_trs[0]).find("td");
            var inputs = "";
            var index = 0;
            for (var i = 1; i < book_trs.length; i++) {
                var tr_tds = $(book_trs[i]).find("td");
                for (var j = 0; j < tr_tds.length; j++) {
                    var value = $(tr_tds[j]).text();
                    if (value == null || value == "" || value == "undefined") {
                        value = "";
                    }
                    inputs = inputs
                            + "<input type='hidden' name='book.goodses["
                            + index + "]." + $(books[j]).attr("lang")
                            + "' value=\"" + value + "\" />";
                }
                index++;
            }
            //alert(inputs);
            $("#book_input").html("");
            $("#book_input").append(inputs);
        }

        $("#businessForm").submit();
    }
</script>
<body>
<div id="mrdForm">

    <table>
        <tr>
            <td>基本资料填写</td>
        </tr>
    </table>
    <table>
        <!-- <tr><td>托运方公司名称</td><td><input type="text" id="company_tname"/></td><td><input type="button" value="获取个人信息"/></td></tr> -->
    </table>
</div>
<form method="post" action="business-edit" id="businessForm">
    <div>
        <ul>
            <li>
                <ul>
                    <li class="li1">公司名称：</li>
                    <li class="li1"><input type="text" id="company"
                                           value='<s:property value="business.shipper.company"/>'
                                           disabled="disabled" name="shipper.company"/></li>
                    <li class="li1">联系人：</li>
                    <li class="li1"><input type="text" id="name"
                                           value='<s:property value="business.shipper.name"/>'
                                           disabled="disabled" name="shipper.name"/></li>
                    <li class="li2">联系电话：</li>
                    <li class="li2"><input type="text" id="phone"
                                           value='<s:property value="business.shipper.phone"/>'
                                           disabled="disabled" name="shipper.phone"/></li>
                    <li class="li2">联系地址：</li>
                    <li class="li2"><input type="text" id="address"
                                           value='<s:property value="business.shipper.address"/>'
                                           disabled="disabled" name="shipper.address"/><input type="hidden"
                                                                                              id="shipId"
                                                                                              value='<s:property value="business.shipper.id"/>'
                                                                                              name="shipper.id"/></li>
                </ul>
            </li>
        </ul>
    </div>

    <div>
        <input type="button" value="提交" onclick="check();"/>
    </div>

    <div id="tabs">
        <ul id="liList">
            <li id="li_book" class="li_content"><a href="#tab_book">订舱</a></li>
            <li id="li_trial" class="li_content"><a href="#tab_trial">拖车</a></li>
            <li id="li_declarate" class="li_content"><a
                    href="#tab_declarate">报关</a></li>
        </ul>
        <!-- 订舱 -->
        <div id="book_input" style="display: none;"></div>
        <input type="hidden" name="book.id"
               value='<s:property value="book.id"/>'/>
        <div id="tab_book" class="div_content">
            <table>
                <tr>
                    <td>货物信息填写：</td>
                </tr>
            </table>
            <div id="newGoods">
                <ul>
                    <li class="li1">货物名称：</li>
                    <li class="li1"><input type="text" id="goodsName"/></li>
                    <li class="li1">毛重：</li>
                    <li class="li1"><input type="text" id="weight"/>kg</li>
                    <li class="li1">体积：</li>
                    <li class="li1"><input type="text" id="volume"/>㎡</li>
                </ul>
                <ul class="ul1">
                    <li class="li1">柜型：</li>
                    <li class="li1"><input type="text" id="model1"/>X20'HD / <input
                            type="text" id="model2"/>X40' / <input type="text" id="model3"/>X40'HQ
                        / <input type="text" id="model4"/>X45'
                    </li>
                    <li class="li1"><input type="hidden" id="isModifyId"/><input
                            type="button" value="确认货物" onclick="confirm();"/></li>
                </ul>
            </div>
            <table>
                <tr>
                    <td>货物列表：</td>
                </tr>
            </table>
            <table id="goodsList">
                <tr>
                    <td lang="name">货物名称</td>
                    <td lang="gWeight">毛重</td>
                    <td lang="volume">体积</td>
                    <td lang="ctNumType">柜型</td>
                    <td style="display: none;" lang="id"></td>
                </tr>
                <s:iterator value="book.goodses" status="indexs">
                    <tr id='goodsList_<s:property value="#indexs.index"/>'
                        onclick="book_modify(this);" class="pointer">
                        <td><s:property value="name"/></td>
                        <td><s:property value="gWeight"/></td>
                        <td><s:property value="volume"/></td>
                        <td><s:property value="ctNumType"/></td>
                        <td style="display: none;"><s:property value="id"/></td>
                    </tr>
                </s:iterator>
            </table>
            <br/>
            <table>
                <tr>
                    <td>收货人信息：</td>
                </tr>
            </table>
            <div>
                <ul>
                    <li class="li1">收货公司名称：</li>
                    <li class="li1"><input id="arr_company" type="text"
                                           value='<s:property value="book.consignee.company"/>'
                                           name="book.consignee.company"/> <input type="hidden"
                                                                                  id="arr_company_id"
                                                                                  name="book.consignee.id"
                                                                                  value='<s:property value="book.consignee.id"/>'/>
                    </li>
                    <li class="li1">联系人：</li>
                    <li class="li1"><input type="text" id="arr_con_name"
                                           value='<s:property value="book.consignee.name"/>'
                                           name="book.consignee.name"/></li>
                    <li class="li1">联系电话：</li>
                    <li class="li1"><input type="text" id="arr_con_phone"
                                           value='<s:property value="book.consignee.phone"/>'
                                           name="book.consignee.phone"/></li>
                </ul>
            </div>
            <table>
                <tr>
                    <td>托运信息：</td>
                </tr>
            </table>
            <div>
                <ul class="ul1">
                    <li class="li1">订舱业务代理人：</li>
                    <li class="li1"><input type="text" id="book_boat_id"
                                           name="book.supCompany.name"
                                           value='<s:property value="book.supCompany.name"/>'/> <input
                            type="hidden" id="book_boat" name="book.supCompany.id"
                            value='<s:property value="book.supCompany.id"/>'/></li>
                    <li class="li1">大船公司：</li>
                    <li class="li1"><input type="text" id="book_ship_id"
                                           value='<s:property value="book.shipping.name"/>'/> <input
                            type="hidden" id="book_ship"
                            value='<s:property value="book.shipping.id"/>'
                            name="book.shipping.id"/></li>
                    <li class="li1">业务类型：</li>
                    <li class="li1">
                        <!-- <input type="text" id="book_busi_type" name="book.businessType"/> -->
                        <select name="book.businessType">
                            <s:iterator value="businessType" status="status">
                                <s:if test="businessType[#status.index][1]==book.businessType">
                                    <option
                                            value='<s:property value="businessType[#status.index][1]"/>'
                                            selected="selected">
                                        <s:property value="businessType[#status.index][0]"/>
                                    </option>
                                </s:if>
                                <s:else>
                                    <option
                                            value='<s:property value="businessType[#status.index][1]"/>'>
                                        <s:property value="businessType[#status.index][0]"/>
                                    </option>
                                </s:else>
                            </s:iterator>
                        </select>
                    </li>
                </ul>
                <ul class="ul1">
                    <li class="li1">起运港：</li>
                    <li class="li1">
                        <!-- <input type="text" name="book.stPort"/> --> <select
                            name="book.stPort">
                        <s:iterator value="ports" status="status">
                            <s:if test="book.stPort==ports[#status.index][1]">
                                <option value='<s:property value="ports[#status.index][1]"/>'
                                        selected="selected">
                                    <s:property value="ports[#status.index][0]"/>
                                </option>
                            </s:if>
                            <s:else>
                                <option value='<s:property value="ports[#status.index][1]"/>'>
                                    <s:property value="ports[#status.index][0]"/>
                                </option>
                            </s:else>
                        </s:iterator>
                    </select>
                    </li>
                    <li class="li1">目的港：</li>
                    <li class="li1">
                        <!-- <input type="text" name="book.arPort"/> --> <select
                            name="book.arPort">
                        <s:iterator value="ports" status="status">
                            <s:if test="book.arPort==ports[#status.index][1]">
                                <option value='<s:property value="ports[#status.index][1]"/>'
                                        selected="selected">
                                    <s:property value="ports[#status.index][0]"/>
                                </option>
                            </s:if>
                            <s:else>
                                <option value='<s:property value="ports[#status.index][1]"/>'>
                                    <s:property value="ports[#status.index][0]"/>
                                </option>
                            </s:else>
                        </s:iterator>
                    </select>
                    </li>
                    <li class="li1">船期要求：</li>
                    <!-- 						<li class="li1"><input type="text" id="book_shipDate" -->
                    <%-- 							value='<s:date name="book.shipDate" format="yyyy-MM-dd"/>' --%>
                    <!-- 							name="book.shipDate" /></li> -->
                    <li class="li1"><input type="text" disabled="disabled"
                                           value='<s:property value="book.shipDate"/>'
                                           name="book.shipDate"/></li>
                </ul>
                <ul class="ul1">
                    <li class="li1">总共需要的柜型柜量：</li>
                    <li class="li1"><input type="text" disabled="disabled"
                                           value='<s:property value="book.ctNumType"/>'
                                           name="book.ctNumType"/></li>
                    <li class="li1">合作价格：</li>
                    <li class="li1"><input type="text"
                                           value='<s:property  value="book.price"/>' name="book.price"/></li>
                    <li class="li1">备注：</li>
                    <li class="li1"><input type="text"
                                           value='<s:property value="book.remark"/>' name="book.remark"/></li>
                </ul>
            </div>
        </div>

        <!-- 拖车 -->
        <div id="tab_trial" class="div_content">
            <div>
                <ul class="ul1">
                    <li class="li1">拖车业务代理人：</li>
                    <li class="li1"><input type="text"
                                           value='<s:property value="trial.supCompany.name"/>'
                                           id="trial_sup_id"/><input type="hidden" id="trial.sup"
                                                                     value='<s:property value="trial.supCompany.id"/>'
                                                                     name="trial.supCompany.id"/></li>
                </ul>
            </div>
            <div id="trial_info_show">
                <table>
                    <tr>
                        <td>装运信息：</td>
                    </tr>
                </table>
                <div id="trial_input">
                    <ul class="ul1">
                        <li class="li1">货物名称：</li>
                        <li class="li1"><input type="text" id="tri_name"/></li>
                        <li class="li1">装柜工厂名称：</li>
                        <li class="li1"><input type="text" id="tri_facname"/></li>
                        <li class="li1">工厂地址：</li>
                        <li class="li1"><input type="text" id="tri_adress"/></li>
                    </ul>
                    <ul class="ul1">
                        <li class="li1">联系人：</li>
                        <li class="li1"><input type="text" id="tri_cname"/><input
                                type="hidden" id="tri_cid"/></li>
                        <li class="li1">联系电话：</li>
                        <li class="li1"><input type="text" id="tri_cphone"/></li>
                        <!-- <li class="li1">柜量：</li><li class="li1"><input type="text" id="model5"/>X20'HD / <input type="text" id="model6"/>X40' / <input type="text" id="model7"/>X40'HQ / <input type="text" id="model8"/>X45'</li> -->
                    </ul>
                    <ul class="ul1">
                        <li class="li1">请选择柜型：</li>
                        <li class="li1"><select id="example" name="example"
                                                multiple="multiple"></select></li>
                    </ul>
                    <ul class="ul1">
                        <li class="li1">建议装柜时间：</li>
                        <li class="li1"><input type="text" id="tri_zhDate"/></li>
                        <li class="li1">备注：</li>
                        <li class="li1"><input type="text" id="tri_remark"/></li>
                        <li class="li1"><input type="button" value="确认货物"
                                               onclick="confirm2();"/></li>
                    </ul>
                </div>
                <table>
                    <tr>
                        <td>货物列表：</td>
                    </tr>
                </table>
                <table id="tril_goodsList">
                    <tr>
                        <td lang="name">货物名称</td>
                        <td lang="factoryName">装柜工厂名称</td>
                        <td lang="id" style="display: none;">装柜工厂id</td>
                        <td lang="factoryAdress">工厂地址</td>
                        <td lang="contacter.name">联系人</td>
                        <td lang="contacter.id" style="display: none;">联系人id</td>
                        <td lang="contacter.phone">联系电话</td>
                        <td>柜型</td>
                        <td lang="zhDate">建议装柜时间</td>
                        <td lang="remark">备注</td>
                        <td style="display: none;" lang="ctNum">柜量</td>
                        <td style="display: none;">id</td>
                    </tr>
                    <s:iterator value="trial.gdes">
                        <tr>
                            <td lang="name"><s:property value="name"/></td>
                            <td lang="factoryName"><s:property
                                    value="contacter.company"/></td>
                            <td lang="id" style="display: none;"><s:property
                                    value="contacter.owner.id"/></td>
                            <td lang="factoryAdress"><s:property
                                    value="contacter.address"/></td>
                            <td lang="contacter.name"><s:property value=""/></td>
                            <td lang="contacter.id" style="display: none;"><s:property
                                    value="contacter.id"/></td>
                            <td lang="contacter.phone"><s:property
                                    value="contacter.phone"/></td>
                            <td><s:property value="ctNumType"/></td>
                            <td lang="zhDate"><s:date name="zhDate" format="yyyy-MM-dd"/></td>
                            <td lang="remark"><s:property value="remark"/></td>
                            <td style="display: none;" lang="ctNum"><s:iterator
                                    value="containers">
                                <s:property value="id"/>:<s:property value="ct_type"/>,</s:iterator></td>
                            <td style="display: none;"><s:property value="id"/></td>
                        </tr>
                    </s:iterator>
                </table>
                <div id="new_tril_goodsList"></div>
                <div id="so">
                    <table>
                        <tr>
                            <td>SO信息：</td>
                        </tr>
                        <tr>
                            <td>上传</td>
                            <td><input type="file"/></td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>

        <!-- 报关 -->
        <div id="tab_declarate" class="div_content">
            <%--      <table>
         <tr><td>基本资料填写：</td></tr>
     </table>
     <div>
         <ul class="ul1">
             <li class="li1">备案号：</li><li class="li1"><input type="text" name="declare.recordNo" id="recordNo"/></li>
             <li class="li1">合同协议号：</li><li class="li1"><input type="text" name="declare.contractNo" id="contractNo"/></li>
             <li class="li1">运抵国：</li><li class="li1"><!-- <input type="text" id="country"/> -->
                 <select name="declare.country" id="country">
                     <s:iterator value="countries" status="status">
                    <option value='<s:property value="countries[#status.index][1]"/>'><s:property value="countries[#status.index][0]"/></option>
                </s:iterator>
                 </select>
             </li>
             <li class="li1">成交方式：</li><li class="li1"><!-- <input type="text" id="turnvorType"/> -->
                 <select name="declare.turnvorType" id="turnvorType">
                     <s:iterator value="deals" status="status">
                    <option value='<s:property value="deals[#status.index][1]"/>'><s:property value="deals[#status.index][0]"/></option>
                </s:iterator>
                 </select>
             </li>
             <li class="li1">备注：</li><li class="li1"><input type="text" name="declare.remark" id="de_remark"/></li>
         </ul>
     </div>
  <table>
         <tr><td>商品信息填写：</td></tr>
     </table>
     <div id="input_declaration">
         <ul class="ul1">
             <li class="li1">备案序号：</li><li class="li1"><input type="text" id="de_recordNo"/></li>
             <li class="li1">商品名称：</li><li class="li1"><input type="text" id="de_commodityName"/></li>
         </ul>
         <ul class="ul1">
             <li class="li1">成交数量：</li><li class="li1"><input type="text" id="de_turnvorNum"/></li>
             <li class="li1">单位：</li><li class="li1"><!-- <input type="text" id="de_turnoverUnit"/> -->
                 <select id="de_turnoverUnit">
                     <s:iterator value="units" status="status">
                    <option value='<s:property value="units[#status.index][1]"/>'><s:property value="units[#status.index][0]"/></option>
                </s:iterator>
                 </select>
             </li>
             <li class="li1">法定数量：</li><li class="li1"><input type="text" id="de_legalNum"/></li>
             <li class="li1">单位：</li><li class="li1"><!-- <input type="text" id="de_legalUnit"/> -->
                 <select id="de_legalUnit">
                     <s:iterator value="units" status="status">
                    <option value='<s:property value="units[#status.index][1]"/>'><s:property value="units[#status.index][0]"/></option>
                </s:iterator>
                 </select>
             </li>
             <li class="li1">第二数量：</li><li class="li1"><input type="text" id="de_sedNum"/></li>
             <li class="li1">单位：</li><li class="li1"><!-- <input type="text" id="de_sedUnit"/> -->
                 <select id="de_sedUnit">
                     <s:iterator value="units" status="status">
                    <option value='<s:property value="units[#status.index][1]"/>'><s:property value="units[#status.index][0]"/></option>
                </s:iterator>
                 </select>
             </li>
         </ul>
         <ul class="ul1">
             <li class="li1">成交总价：</li><li class="li1"><input type="text" id="de_totlePrice"/></li>
             <li class="li1">币制：</li><li class="li1"><!-- <input type="text" id="de_currency"/> -->
                 <select id="de_currency">
                     <s:iterator value="currencys" status="status">
                    <option value='<s:property value="currencys[#status.index][1]"/>'><s:property value="currencys[#status.index][0]"/></option>
                </s:iterator>
                 </select>
             </li>
             <li class="li1">目的地：</li><li class="li1"><!-- <input type="text" id="de_arplace"/> -->
                 <select id="de_arplace">
                     <s:iterator value="ports" status="status">
                    <option value='<s:property value="ports[#status.index][1]"/>'><s:property value="ports[#status.index][0]"/></option>
                </s:iterator>
                 </select>
             </li>
             <li class="li1"><input type="button" value="确认商品" onclick="confirm3();"/></li>
         </ul>
     </div>
     <table>
         <tr><td>商品列表：</td></tr>
     </table>
     <table id="de_goodsList">
         <tr><td lang="recordNo">备案序号</td><td lang="commodityName">商品名称</td><td lang="turnvorNum">成交数量</td>
         <td>单位</td><td lang="turnoverUnit" style="display: none;">单位id</td>
         <td lang="legalNum">法定数量</td><td>单位</td><td lang="legalUnit" style="display: none;">单位id</td>
         <td lang="sedNum">第二数量</td><td>单位</td><td lang="sedUnit" style="display: none;">单位id</td>
         <td lang="totlePrice">成交总价</td><td>币制</td><td lang="currency" style="display: none;">币制id</td>
         <td>目的地</td><td lang="arplace" style="display: none;"></td></tr>
     </table>
     <div id="new_de_goodsList"></div>
     <div id="ship">
         <table>
             <tr><td>前置信息：</td></tr>
         </table>
         <table>
            <tr><td>船名</td><td></td></tr>
            <tr><td>航次</td><td></td></tr>
        </table>
     </div> --%>

            <table rules="rows" id="baseInfoTB">
                <tr>
                    <td class="labelTD">预录入编号</td>
                    <td><input type="text" class="textInput" id="SNO"
                               maxlength="9"/></td>
                    <td class="labelTD" id="label_ep">出口口岸</td>
                    <td><input type="text" class="textInput" id="EXPORT_PORT"/></td>
                    <td class="labelTD">备案号</td>
                    <td><input type="text" class="textInput" id="RECORD_ID"
                               maxlength="12" onblur="checkRECORD_ID()"/></td>
                </tr>
                <tr>
                    <td class="labelTD">合同协议号</td>
                    <td colspan="3"><input type="text" class="textInput"
                                           id="CONTRACT_NO" style="width: 306px;" maxlength="20"
                                           title="最长20个字符"/></td>
                    <td class="labelTD" id="label_epdate">出口日期</td>
                    <td><input type="text" class="textInput" id="EXPORT_DATE"/></td>
                </tr>
                <tr>
                    <td class="labelTD">经营单位</td>
                    <td><input type="text" class="textInput" id="COMPANY_CO"/></td>
                    <td colspan="2"><input type="text" class="textInput"
                                           id="COMPANY_NAME" style="width: 204px;"/></td>
                    <td class="labelTD">运输方式</td>
                    <td><input type="text" class="textInput" id="TRANSPORT_MODE"/></td>
                </tr>
                <tr>
                    <td class="labelTD" id="label_fahuo">发货单位</td>
                    <td><input type="text" class="textInput"
                               id="FAHUO_COMPANY_CO"/></td>
                    <td colspan="2"><input type="text" class="textInput"
                                           id="FAHUO_COMPANY_NAME" style="width: 204px;"/></td>
                    <td class="labelTD"></td>
                    <td class="labelTD"></td>
                </tr>
                <tr>
                    <td class="labelTD">申报单位</td>
                    <td><input type="text" class="textInput"
                               id="SHENBAO_COMPANY_CO"/></td>
                    <td colspan="2"><input type="text" class="textInput"
                                           id="SHENBAO_COMPANY_NAME" style="width: 204px;"/></td>
                    <td class="labelTD"></td>
                    <td class="labelTD"></td>
                </tr>
                <tr>
                    <td class="labelTD">运输工具名称</td>
                    <td colspan="3"><input type="text" class="textInput"
                                           id="TRANSPORT_NA" style="width: 306px;"/></td>
                    <td class="labelTD">航次号</td>
                    <td><input type="text" class="textInput" id="VOYAGE_NO"/></td>
                </tr>
                <tr>
                    <td class="labelTD">提运单号</td>
                    <td><input type="text" class="textInput" id="BL_NO"
                               maxlength="15" title="最长15个字符"/></td>
                    <td class="labelTD">监管方式</td>
                    <td><input type="text" class="textInput" id="TRADE_MODE"/></td>
                    <td class="labelTD">征免性质</td>
                    <td><input type="text" class="textInput" id="LEVYMODE"/></td>
                </tr>
                <tr>
                    <td class="labelTD" id="label_lc_type">结汇方式</td>
                    <td><input type="text" class="textInput" id="LC_TYPE"/></td>
                    <td class="labelTD">纳税单位</td>
                    <td><input type="text" class="textInput" id="TEX_COMPANY"/></td>
                    <td class="labelTD">许可证号</td>
                    <td><input type="text" class="textInput" id="LICENSE_NO"/></td>
                </tr>
                <tr>
                    <td class="labelTD" id="label_arrived_country">运抵国</td>
                    <td><input type="text" class="textInput" id="ARRIVED_COUNTRY"/></td>
                    <td class="labelTD" id="label_arrived_port">指运港</td>
                    <td><input type="text" class="textInput" title=""
                               id="ARRIVED_PORT"/></td>
                    <td class="labelTD" id="goods_place">境内货源地</td>
                    <td><input type="text" class="textInput" id="GOODS_ADDR"/></td>
                </tr>
                <tr>
                    <td class="labelTD">批准文号</td>
                    <td><input type="text" class="textInput" id="APPROVAL_NO"/></td>
                    <td class="labelTD">成交方式</td>
                    <td><input type="text" class="textInput" id="DEAL_MODE"/></td>
                    <td class="labelTD"></td>
                    <td class="labelTD"></td>
                </tr>
                <tr>
                    <td class="labelTD">运费</td>
                    <td><input type="text" class="textInput" id="FREIGHT1"/></td>
                    <td><input type="text" class="textInput" id="FREIGHT2"/></td>
                    <td><input type="text" class="textInput" id="FREIGHT3"/></td>
                    <td class="labelTD"></td>
                    <td class="labelTD"></td>
                </tr>
                <tr>
                    <td class="labelTD">保费</td>
                    <td><input type="text" class="textInput" id="PREMIUM1"/></td>
                    <td><input type="text" class="textInput" id="PREMIUM2"/></td>
                    <td><input type="text" class="textInput" id="PREMIUM3"/></td>
                    <td class="labelTD"></td>
                    <td class="labelTD"></td>
                </tr>
                <tr>
                    <td class="labelTD">杂费</td>
                    <td><input type="text" class="textInput" id="OTHERFEE1"/></td>
                    <td><input type="text" class="textInput" id="OTHERFEE2"/></td>
                    <td><input type="text" class="textInput" id="OTHERFEE3"/></td>
                    <td class="labelTD"></td>
                    <td class="labelTD"></td>
                </tr>
                <tr>
                    <td class="labelTD">件数</td>
                    <td><input type="text" class="textInput" id="GOODS_COUNT"/></td>
                    <td class="labelTD">包装种类</td>
                    <td><input type="text" class="textInput" id="GOODS_PACKAGE"/></td>
                    <td class="labelTD">毛重（KG）</td>
                    <td><input type="text" class="textInput" id="GROSS_WEIGHT"/></td>
                </tr>
                <tr>
                    <td class="labelTD">净重（KG）</td>
                    <td><input type="text" class="textInput" id="NET_WEIGHT"/></td>
                    <td class="labelTD">随附单证</td>
                    <td><input type="text" class="textInput" id="SUIFUDAN"/></td>
                    <td class="labelTD">报关单类型</td>
                    <td><input type="text" class="textInput" id="CUSTOMS_TYPE"/></td>
                </tr>
                <tr>
                    <td class="labelTD">备注</td>
                    <td colspan="5"><input type="text" class="textInput"
                                           id="REMARK" style="width: 494px;"/></td>
                </tr>
            </table>

            <table rules="rows" id="goodsListTB" class="dataTB">
                <tr class="titleTR"
                    title="选中记录后，Ctrl+Z复制记录，Ctrl+U向上移动记录，Ctrl+I插入记录">
                    <td class="titleTD" style="width: 35px;">序号</td>
                    <td class="titleTD" style="width: 65px;">商品编号</td>
                    <td class="titleTD" style="width: 65px;">备案序号</td>
                    <td class="titleTD" style="width: 120px;">商品名称</td>
                    <td class="titleTD" style="width: 100px;">规格</td>
                    <td id="label_td_gdestination" class="titleTD"
                        style="width: 70px;">目的地
                    </td>
                    <td class="titleTD" style="width: 50px;">数量</td>
                    <td class="titleTD" style="width: 50px;">单位</td>
                    <td class="titleTD" style="width: 50px;">币制</td>
                    <td class="titleTD" style="width: 50px;">总价</td>
                    <td class="hiddenValue" style="width: 35px;">征免</td>
                    <td class="hiddenValue">附加编号</td>
                    <td class="hiddenValue">成交单价</td>
                    <td class="hiddenValue">法定数量</td>
                    <td class="hiddenValue">法定单位</td>
                    <td class="hiddenValue">版本号</td>
                    <td class="hiddenValue">货号</td>
                    <td class="hiddenValue">生产厂家</td>
                    <td class="hiddenValue">第二数量</td>
                    <td class="hiddenValue">第二单位</td>
                    <td class="hiddenValue">工缴费</td>
                    <td class="hiddenValue">主键</td>
                    <td class="hiddenValue">附加编号位置</td>
                </tr>
            </table>
            <table style="margin: 0 0 20px 566px;">
                <tr>
                    <td class="labelTD">总价汇总：</td>
                    <td id="gTotal" class="goodsInput disableInput"
                        style="color: red;"></td>
                </tr>
            </table>


        </div>
    </div>
</form>
</body>
</html>
